package com.concurrent.sample.business.event.assemble;

import com.concurrent.sample.business.event.dto.EventDTO;
import com.concurrent.sample.business.event.entity.EventEntity;
import com.concurrent.sample.common.util.InstantUtils;
import java.time.Instant;
import java.time.LocalDateTime;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants.ComponentModel;

@Mapper(componentModel = ComponentModel.SPRING)
public interface EventAssemble {

  EventDTO toDTO(EventEntity event);

  default LocalDateTime toLocalDateTime(Instant instant) {
    return InstantUtils.toLocalDateTime(instant);
  }

}
